using System;
using System.Collections.Generic;
using System.Text;

namespace Impact.Model.Objects
{
    public partial class ImpactPageCollection
    {

        /// <summary>
        /// loads all the pages in the collection and all of their children into memory (cached).
        /// </summary>
        /// <param name="onlyEnabledPages">true to only load pages that are enabled.  false to load all pages</param>
        public ImpactPageCollection LoadDeep(bool onlyEnabledPages)
        {
            this.Load();
            /*
            // TODO: would be a good place for a transaction when SubSonic supports it

            Stack<ImpactPage> pages = new Stack<ImpactPage>(this);
            while (pages.Count > 0)
            {
                ImpactPage parent = pages.Pop();
                // GetChildren forces all child pages to load
                PageCollection children = parent.GetChildren(onlyEnabledPages);
                foreach (ImpactPage child in children)
                {
                    pages.Push(child);
                }
            }
            return this;
            */

            throw new Exception("Method or operation not implemented.");
        }

    }
}
